﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<input type="hidden" name="zh_parsen/fzr_name"
       value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>"/>
<input type="hidden" name="zh_parsen/fzr_mobile"
       value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>"/>
<input type="hidden" name="zh_parsen/fzr_tel"
       value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>"/>
<input type="hidden" name="zh_parsen/fzr_email"
       value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>"/>

<input type="hidden" id="if_have_org" name="proposal/if_have_org">

<div class="t_bar">${param.title}</div>
<table class="t_css" width="100%"  id="basic_info" border="0" cellpadding="0"
       cellspacing="1">
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <tr class="li_1">
        <td align="right"><span class="color_red">*</span>榜单名称：</td>
        <td colspan="3">
            <input type='text' name='proposal/zh_title' onchange="reqName()" id='zh_title' style="width: 88%"
                   class="input_css required maxlength:100" maxlength="100"
                   value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="榜单名称">
        </td>
    </tr>
    <tr>
        <td align="right"><span class="color_red">*</span>归口管理部门：</td>
        <td>
            <c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value"/>','name':'<x:out
                    select="$xmlData/data/proposal/recomend_org_name"/>'}</c:set>
            <cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true"
                      value="${recomend_org}" label="归口管理部门"
                      id="recomend_org" showPattern="all" shieldPattern="0" topCheckbox="false"
                      onClick="initTreeValueExt"/>
            <input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" class="required"
                   value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理部门">
            <input type="hidden" name="proposal/recomend_org_name"
                   value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">

        </td>
        <td align="right"><span class="color_red">*</span>申报日期：</td>
        <td>
            <c:set var="submit_date">
                <x:out select="$xmlData/data/proposal/submit_date"/>
            </c:set>
            <cpt:date id="apply_date_curr" name="proposal/submit_date" value="${submit_date}" className="required date"
                      label="申报日期"></cpt:date>
        </td>
    </tr>
</table>
<div class="t_bar">揭榜方基本情况</div>
<table class="t_css" width="100%" id="basic_info_jzfp" border="0" cellpadding="0"
       cellspacing="1">
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <col style="width: 25%"/>

    <tr>
        <td align="right"><span class="color_red">*</span>揭榜方名称：</td>
        <td colspan="3">
            <input type='text' name='proposal/org_name'  style="width: 88%"
                   class="input_css required maxlength:50" maxlength="50"
                   value='<x:out select="$xmlData/data/proposal/org_name"/>' label="揭榜方名称">
        </td>
    </tr>
    <tr>
        <td align="right"><span class="color_red">*</span>揭榜方地址：</td>
        <td >
            <input type='text' name='proposal/address'
                   class="input_css required maxlength:50" maxlength="50"
                   value='<x:out select="$xmlData/data/proposal/address"/>' label="揭榜方地址">
        </td>

        <td align="right"><span class="color_red">*</span>邮编：</td>
        <td >
            <input type='text' name='proposal/zip_code'   onkeyup="this.value=this.value.replace(/\D/g,'')"   onafterpaste="this.value=this.value.replace(/\D/g,'')"
                   class="input_css required maxlength:6" maxlength="6"
                   value='<x:out select="$xmlData/data/proposal/zip_code"/>' label="邮编">
        </td>
    </tr>

    <tr>

        <td align="right"><span class="color_red">*</span>揭榜方从事行业：</td>
        <td >
            <input type='text' name='proposal/major_work'
                   class="input_css required maxlength:30" maxlength="30"
                   value='<x:out select="$xmlData/data/proposal/major_work"/>' label="揭榜方从事行业">
        </td>
        <td align="right"><span class="color_red">*</span>注册地：</td>
        <td >
            <input type='text' name='proposal/area_name'
                   class="input_css required maxlength:50" maxlength="50"
                   value='<x:out select="$xmlData/data/proposal/area_name"/>' label="注册地">
        </td>
    </tr>

    <tr>
        <td align="right"><span class="color_red">*</span>揭榜方所属区域：</td>
        <td colspan="3">
            <c:set var="area_nature"><x:out select="$xmlData/data/proposal/area_nature_value" /></c:set>
            <cpt:checkbox key="area_nature" name="area_nature"  value="${area_nature }" width="80px;" repeatColumn="3" tagType="checkbox" ></cpt:checkbox>
            <input type="hidden" id="area_nature_value" name="proposal/area_nature_value"  class="required"  value="<x:out select="$xmlData/data/proposal/area_nature_value" />" label="揭榜方所属区域">
            <input type="hidden" name="proposal/area_nature_name" value="<x:out select="$xmlData/data/proposal/area_nature_name" />">

        </td>
    </tr>

    <tr>
        <td align="right"><span class="color_red">*</span>揭榜方性质：</td>
        <td colspan="3">
            <c:set var="unveiling_party_value">
                <x:out select="$xmlData/data/proposal/unveiling_party_value" />
            </c:set>
            <c:set var="unveiling_party_other">
                <x:out select="$xmlData/data/proposal/unveiling_party_other" />
            </c:set>
            <cpt:checkbox key="unveiling_party" name="unveiling_party" tagType="radio"
                          width="25%" repeatColumn="4" value="${unveiling_party_value }"
                          lastOther="true" otherId="unveiling_party_other"
                          otherValueName="${unveiling_party_other }"></cpt:checkbox>
            <input type="text" id="unveiling_party_other"
                   name="proposal/unveiling_party_other" maxlength="50"
                   style="border: none; border-bottom: 1px solid gray; width: 100px;"
                   label="揭榜方性质-->其他"
                   value="<x:out select="$xmlData/data/proposal/unveiling_party_other"/>" />
            <input type="hidden" id="unveiling_party_value"
                   name="proposal/unveiling_party_value" class="required"
                   value="${unveiling_party_value}" label="揭榜方性质">
            <input type="hidden" name="proposal/unveiling_party_name"
                   value="<x:out select="$xmlData/data/proposal/unveiling_party_name" />">
        </td>
    </tr>

    <tr>
        <td align="right"><span class="color_red">*</span>组织机构代码/统一社会信用代码：</td>
        <td colspan="3">
        <input type='text' name='proposal/org_no'   style="width: 88%"
               class="input_css required orgShxyCard" maxlength="18"
               value='<x:out select="$xmlData/data/proposal/org_no"/>' label="组织机构代码/统一社会信用代码">
        </td>
    </tr>
    <tr>
        <td align="right"><span class="color_red">*</span>税务登记号：</td>
        <td>
            <input type='text' name='proposal/tax_local_no'
                   class="input_css required " maxlength="50"
                   value='<x:out select="$xmlData/data/proposal/tax_local_no"/>' label="税务登记号">
        </td>
        <td align="right"><span class="color_red">*</span>营业执照注册号：</td>
        <td>
            <input type='text' name='proposal/org_licence'
                   class="input_css required " maxlength="50"
                   value='<x:out select="$xmlData/data/proposal/org_licence"/>' label="营业执照注册号">
        </td>
    </tr>
    <tr>
        <td align="right"><span class="color_red">*</span>联系人姓名：</td>
        <td>
            <input type="text" label="联系人姓名" name="proposal/contact_psn_cname" class="input_css required"
                   maxlength="30" value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />">
        </td>
        <td align="right"><span class="color_red">*</span>联系人职务：</td>
        <td>
            <input type="text" label="联系人职务" name="proposal/contact_position" class="input_css required " maxlength="30"
                   value="<x:out select="$xmlData/data/proposal/contact_position" />">
        </td>
    </tr>

    <tr>
        <td align="right"><span class="color_red">*</span>联系人手机：</td>
        <td>
            <input type="text" label="联系人手机" name="proposal/contact_psn_mobile" class="input_css required mobile"
                   onfocus="InitInput.setNumber(this,11,0,0)" maxlength="11"
                   value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />">
        </td>
        <td align="right"><span class="color_red">*</span>联系人电子邮箱：</td>
        <td>
            <input type="text" label="联系人电子邮箱" name="proposal/contact_email" class="input_css required email"
                   maxlength="30" value="<x:out select="$xmlData/data/proposal/contact_email" />">
        </td>

    </tr>

    <tr>
        <td align="right">项目负责人：</td>
        <td>
            <span name="proposal/fzr_psnname"><x:out
                    select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/></span>
        </td>
        <td align="right">手机号码：</td>
        <td>
            <span name="proposal/fzr_mobile"><x:out
                    select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/></span>
        </td>
    </tr>

    <tr>
        <td align="right">电子邮箱：</td>
        <td>
            <span name="proposal/fzr_email"><x:out
                    select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/></span>
        </td>
        <td align="right">联系电话：</td>
        <td>
            <span name="proposal/fzr_tel"><x:out
                    select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/></span>
        </td>
    </tr>
    <tr>
        <td align="right"><span class="color_red">*</span>内设学院或机构<br/>（没有可填无）：</td>
        <td colspan="3">
            <input type="text" name="proposal/built_institute" class="required" onchange="synchronizationAmount1()"
                   id="built_institute" style="text-align: left;width: 88%;" maxlength="30"
                   value="<x:out select="$xmlData/data/proposal/built_institute"/>" label="内设学院或机构">
        </td>
    </tr>

    <tr>
        <td align="right"><span class="color_red">*</span>项目开始时间：</td>
        <td>
            <c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date"/></c:set>
            <cpt:date id="start_date" name="proposal/start_date" label="项目开始时间" value="${start_date }" className=" required  date  "  ></cpt:date>
        </td>
        <td align="right"><span class="color_red">*</span>项目结束时间：</td>
        <td>
            <c:set var="end_date"><x:out select="$xmlData/data/proposal/end_date"/></c:set>
            <cpt:date id="end_date" name="proposal/end_date" label="项目结束时间" value="${end_date }" className=" required  date dateCompareAfterE:end_date:start_date "></cpt:date>
        </td>
    </tr>
    <tr>

        <td align="right"><span class="color_red">*</span>项目研发总投入金额（万元）：</td>
        <td >
            <input type='text' name='proposal/total_amount' class="required" id='total_amount'
                   onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;"
                   value='<x:out select="$xmlData/data/proposal/total_amount"/>'
                   label="项目研发总投入金额">
        </td>

        <td align="right"><span class="color_red">*</span>项目申请金额（万元）：</td>
        <td >
            <input type='text' name='proposal/request_amount' class="required" id='request_amount'
                   onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;"
                   onchange="synchronizationAmount();" value='<x:out select="$xmlData/data/proposal/request_amount"/>'
                   label="项目申请金额">
        </td>
    </tr>
</table>
<br/>

<div class="t_bar"><span class="color_red">*</span>揭榜方简介（科研情况、人才队伍、生产经营情况等，600字以内）</div>
<table id="tblMileStones8" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0"
       style="*border-bottom: #a1c0dc 1px solid;">
    <col style="width:34%"/>
    <col style="width:40%"/>
    <col style="width:13%"/>
    <col style="width:13%"/>
    <tr>
        <td colspan="4">
            <textarea name="project/goal" style="width:98%" class="input_textarea required maxlength:600" label="揭榜方简介"
                      rows=5 cols=60><x:out select="$xmlData/data/project/goal"/></textarea>
            <input type="hidden" name="project/goal_hidden" id="project/goal_hidden"
                   value="<x:out select="$xmlData/data/project/goal_hidden" />"/>
        </td>
    </tr>
</table>
<script type="text/javascript">
    $(function () {
       // getLen();
    });
    /***
     * 初始化科技型中小企业选择框是否为可选
     */
   /* $(document).ready(function () {
        if ($('input:checkbox[name="enterprise_scale"]:checked').val() == "中小企业") {
            $("#technologyEnterprise").removeAttr("disabled");
        } else {
            $("#technologyEnterprise").attr("disabled", true);
        }
    });*/

    /***
     * 勾选中小型企业框时打开科技型中小企业选择
     * 没有勾选时关闭科技型中小企业选择，并清除隐藏域的值
     *
     */
    function removeDisabled() {
        if ($('input:checkbox[name="enterprise_scale"]:checked').val() == "中小企业") {
            $("#technologyEnterprise").removeAttr("disabled");
        } else {
            $("#technologyEnterprise").removeAttr("checked");
            $("#technology_enterprise_value").val("");
            $("#technologyEnterprise").attr("disabled", true);
        }
    };

    function synchronizationAmount() {
        var request_amount = $("#request_amount").val();
        if (request_amount != "") {
            $("#total_each_0").val(parseFloat($("#request_amount").val()).toFixed(2));
            countFundAuto('total_', 'each_0,each_1,each_2,each_4', 'investfrom_5');
        } else if (request_amount == "") {
            $("#total_each_0").val("");
            countFundAuto('total_', 'each_0,each_1,each_2,each_4', 'investfrom_5');
        }
    }

    function synchronizationAmount1() {
        var built_institute = $("#built_institute").val();
        if (built_institute != "") {
            $("span[id='built_institute_[00]']").html($("#built_institute").val());
            $("#built_instituteview").text($("#built_institute").val());
        } else {
            $("span[id='built_institute_[00]']").html("");
            $("#built_instituteview").text("");
        }
    }

    function initTreeValueExt(treeId, treeNode) {
        if ((treeNode && treeNode.isParent)) {
            scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
            $("#" + treeId).val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
            return false;
        }
        var str = treeNode.name;
        var obj = treeNode.parentNode;
        while (obj != null) {
            str = obj.name + "-" + str;
            obj = obj.parentNode;
        }

        $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
    }

    function getLen() {
        var len = $("#tblorg_hzs tr:gt(1)").length;
        if (len > 0) {
            $("#if_have_org").val("1");
        } else {
            $("#if_have_org").val("0");
        }
    }

    function setCooperationUnits() {
        var cooperation_units = "";
        $("#tblorg_hzs tr:gt(1)").each(function (index) {
            var cooperation_unit = $(this).find("td:eq(2) input").val().trim();
            /*var orgName = $("#org_name").val().trim();*/
            var orgName = $('span[name$="organizations/organization/org_name"]').html()
            if (!isBlankOrNull(cooperation_unit) && cooperation_unit != orgName) {
                cooperation_units += cooperation_unit + ",";
            }
            /* if(!isBlankOrNull(cooperation_unit)){
                 cooperation_units += cooperation_unit+",";
             }*/
        });
        if (cooperation_units != "") {
            cooperation_units = cooperation_units.substring(0, cooperation_units.length - 1);
        }
        $("#cooperation_units").val(cooperation_units);
    }

    function initSubjectTreeValueExp(treeId, treeNode) {
        /*if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
            scmWarn($("#" + treeId).attr("label") + "不能选择第一级，请选择它的子级！");
            if (treeNode.level == null) {
                $("#" + treeId).val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
            }
            return false;
        }*/
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(treeNode.name.substring(treeNode.name.indexOf(".") + 1));
        //触发研究方向
        //checkDisCodeExp(treeNode.id,treeId,true); //下拉树
        //checkDisCodeSelect(treeNode.id,treeId,true);
    }
</script>
